<template>
    <div class="cus-container">

        <el-table class="custable" :data="data" size="medium" stripe>
            <el-table-column type="selection" width="50" align="center"></el-table-column>
            <el-table-column type="index" width="50" align="center" label="序号"></el-table-column>
            <el-table-column v-for="(v, k) in state.labels" align="center" :key="k" :label="v.label" min-width="100px"
                :prop="v.prop"></el-table-column>
            <el-table-column fixed="right" width="100" label="操作" align="center">
                <template #default>
                    <div class="btns">
                        <img src="./edit.png" alt="">
                        <img src="./delete.png" alt="">
                    </div>
                </template>
            </el-table-column>
        </el-table>
        <el-pagination class="page" v-model:current-page="state.page" :page-size="state.pagesize" small background
            layout="total, prev, pager, next" :total="1000" />
    </div>
</template>
<script setup lang="ts">
import { reactive } from "vue"
defineProps({
    data: {
        type: Array,
        default: []
    }
})
const state = reactive({
    labels: [
        { label: '农作物种类', prop: 'A' },
        { label: '土壤类型', prop: 'B' },
        { label: '二氧化碳浓度', prop: 'C' },
        { label: 'pm2.5', prop: 'D' },
        { label: '月平均降水量', prop: 'E' },
        { label: 'NDVI', prop: 'F' },
        { label: '光照度', prop: 'G' },
        { label: '日照时长', prop: 'H' },
        { label: '低保积温', prop: 'I' },
        { label: '记录时间', prop: 'J' },
        { label: '区域', prop: 'K' },
    ],
    page: 1,
    pagesize: 10,
})
</script>
<style lang="scss">
.custable {
    background: transparent !important;
    border: none !important;
    // height: 100%;
    flex: 1;

    .el-table__header-wrapper {
        .el-table__header {
            thead {
                background: #004b85 !important;
                color: #fff !important;

                tr {
                    background: #004b85 !important;

                    th {
                        background: #004b85 !important;
                    }
                }
            }
        }
    }

    .el-table__row {
        background: #0a253b !important;
        color: #fff !important;

        td {
            background: #0a253b !important;
            border: none !important;
        }
    }

    .el-table__row--striped {
        background: #072b45 !important;

        td {
            background: #072b45 !important;

        }
    }
}
.page{
    .el-pagination__total {
        color: #fff !important;
        font-weight: 600;
    }
    .el-pager{
        .number,.more{
            background: #072b45 !important;
            color: #fff !important;
            font-weight: 600;
        }
        .is-active{
            color: #fff !important;
            font-weight: 600;
            background: #004b85 !important;
        }
    }
    .btn-prev,.btn-next{
        color: #fff !important;
        font-weight: 600;
        background: #072b45 !important;
    }
}
</style>

<style lang="less" scoped>
.cus-container {
    height: 100%;
    display: flex;
    flex-direction: column;

    .page {
        margin-top: 10px;
    }
}

.btns {
    display: flex;
    // justify-content: center;
    justify-content: space-around;

    img {
        cursor: pointer;
        width: 16px;
    }
}
</style>